package com.tdam2011.grupo02.data;

import android.content.Context;

public class DatabaseHelperSingleton {

	private DatabaseHelper dbHelper = null;
	private static DatabaseHelperSingleton dbHelperSingleton = null;

	private DatabaseHelperSingleton(Context context) {
		dbHelper = new DatabaseHelper(context.getApplicationContext());
	}

	private static void createInstance(Context context) {
		if (dbHelperSingleton == null)
			dbHelperSingleton = new DatabaseHelperSingleton(context);
	}

	public static DatabaseHelperSingleton getInstance(Context context) {
		if (dbHelperSingleton == null)
			createInstance(context);

		return dbHelperSingleton;
	}

	public DatabaseHelper getDatabaseHelper() {
		return dbHelper;
	}
	
}
